<template>
  <el-dialog
    title="车辆停用"
    :visible="noShow"
    width="30%"
    @close="close"
  >
    <div>
      <span>确定要停用吗？</span>
      <div style="margin-top: 20px;">1.车辆当前无运输任务 </div>
      <div style="margin-top: 20px;">2.车辆无关联运输线路</div>
      <div>注：停用后司机将自动解除绑定</div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="close">取 消</el-button>
      <el-button type="primary" @click="confirm">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { Disable } from '../../api/carList'
export default {
  props: {
    noShow: {
      type: Boolean,
      default: false
    },
    operateId: {
      type: Number,
      default: null
    }
  },
  methods: {
    close() {
      this.$emit('update:noShow', false)
    },
    async confirm() {
      await Disable(this.operateId)
      this.$message.success('启用成功')
    }
  }

}
</script>

<style>

</style>
